package com.shijiwei.lifthelper.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView;

import com.shijiwei.lifthelper.R;

import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

/**
 * Created by sjw on 2015/12/19.
 */
public class WebActivity extends AppCompatActivity {
    private String urlStr;
    @ViewInject(R.id.webview)
    private WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web);
        x.view().inject(this);
        Intent intent = getIntent();
        urlStr = intent.getStringExtra("url");
        webView.loadUrl(urlStr);
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        if (!webView.isActivated()){
            finish();
        }
    }
}
